clc;
clear all;
close all;

%% Load image
pathname = '';
filename = 'harbour.bmp';
img = imread([pathname filename]);
% img = double(rgb2gray(img));
img = double(img);
blk_w = 8;
blk_h = 8;
%% test vm_map_vg
load 'fv.mat';
map = vm_map_vg(img, blk_w, blk_h, b_fv, e_fv, s_fv, t_fv);
figure; subplot(1,2,1);imshow(img, []);
subplot(1,2,2);imshow(map,[]);
%% test vm_map_dct
map = vm_map_dct(img, blk_w, blk_h);
figure; subplot(1,2,1);imshow(img, []);
subplot(1,2,2);imshow(map,[]);
%% test vm_im2blk
blk_list = vm_im2blk(img, blk_w,  blk_h);

%% test vm_maprender
[br bc] = size(blk_list);
blk_type = rand(br, bc);
map = vm_maprender(img, blk_list, blk_type);
figure; imshow(map, []);

%% test vm_map
map = vm_map_ed(img, blk_w, blk_h);
figure; subplot(1,2,1);imshow(img, []);
subplot(1,2,2);imshow(map,[]);

